﻿using System;
using System.Collections.Generic;
using System.Text;
using NIIT.SaoBacDau.Aupi.HospitalManagement.Entities;
using System.Data.SqlClient;
using System.Data;

namespace NIIT.SaoBacDau.Aupi.HospitalManagement.DataAccess
{
    public class DAO_HR_TypeDoctor
    {
        public static HR_TypeDoctor hr_TypeDoctor(HR_TypeDoctor hR_TypeDoc)
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("HumanResources.HRTypeDoctor", DAO_ConnectDatabase.Connect());
            sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
            sqlda.SelectCommand.Parameters.Add("@TypeDoctorID", SqlDbType.Int).Value = hR_TypeDoc.TypeDoctorID;
            DataTable dtable = new DataTable();
            sqlda.Fill(dtable);
            HR_TypeDoctor hR_Doc = new HR_TypeDoctor();
            hR_Doc.TypeDoctorID = hR_TypeDoc.TypeDoctorID;
            hR_Doc.NameTypeDoctor = dtable.Rows[0]["NameTypeDoctor"].ToString();
            return hR_Doc;
        }
    }
}
